from ddt import ddt, data, unpack
import unittest


# 案例1：单个数据
@ddt
class Test(unittest.TestCase):

    @data(111, 22, 33, 444)
    def test1(self, value):
        print(f'打印values值:{value}')


# 案例2：组合数据，未拆分
@ddt
class Test2(unittest.TestCase):
    @data(['aaa', 'bbb', 'ccc'], ['dd', 'ee', 'ff'])
    def test2(self, value):
        print(value)


# 案例3：组合数据，拆分（重点）
@ddt
class Test3(unittest.TestCase):
    @data(['aaa', 'bbb', 'ccc'], ['dd', 'ee', 'ff'])
    @unpack
    def test3(self, value1, value2, value3):
        print(value1, value2, value3)


if __name__ == '__main__':
    unittest.main()
